﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CoVuaClient
{
    class QuanVua : QuanCo
    {
        private bool _chuaXuatQuan;
        public QuanVua(bool pheMinh)
        {
            TenQuanCo = "Vua";
            PheMinh = pheMinh;
            ChuaXuatQuan = true;
            if (PheMinh)
            {
                PathImage = @"/CoVuaClient;component/Pic/KingYellow.png";
            }
            else
            {
                PathImage = @"/CoVuaClient;component/Pic/KingBlack.png";
            }
        }

        public bool ChuaXuatQuan
        {
            get { return _chuaXuatQuan; }
            set { _chuaXuatQuan = value; }
        }

        public override List<OCo> NhungOCoTheDi(BanCo banCo, OCo oHienTai, bool kiemTraChieuTuong)
        {
            List<OCo> danhSach = new List<OCo>();
            foreach (var oCo in oHienTai.DanhSachOXungQuanh())
            {
                if (!KiemTraCoQuanTa(banCo,oCo))
                {
                    danhSach.Add(oCo);
                }
            }
            return danhSach;
        }
        public override void ChangeState()
        {
            DangChon = !DangChon;
            if (DangChon)
            {
                PathImage = @"/CoVuaClient;component/Pic/KingYellowChecked.png";
            }
            else
            {
                PathImage = @"/CoVuaClient;component/Pic/KingYellow.png";
            }
        }
    }
}
